Using Unix find `pwd`
NickName:Deep Ask DateTime:2016-04-23T06:42:52

Using Unix find `pwd`

I am trying to use the Unix find command in Python and can't get to input pwd, `pwd` did not work either.

import commands
import os

f = raw_input('Enter name of the file: ')
fh = open(f, 'r')

prevdir = os.getcwd()
files = fh.readlines()

for line in files:
    os.chdir(line)
    print commands.getoutput('find `pwd` -name "*.txt"')
    # print commands.getoutput('find \`pwd\` -name "*.txt"')

Copyright Notice:Content Author:「Deep」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/36804405/using-unix-find-pwd

More about “Using Unix find `pwd`” related questions

Using Unix find `pwd`

I am trying to use the Unix find command in Python and can't get to input pwd, `pwd` did not work either. import commands import os f = raw_input('Enter name of the file: ') fh = open(f, 'r') pr.

Show Detail

Shorthand for specifying path as pwd in Unix?

I'd like to know if there's a built in shortcut or a way to create an alias for the path in a command when the path is the pwd. For example, lets say my pwd is ~/Desktop/Unix_Folder/Unix_Sub_Folder...

Show Detail

unix shell - ls -d $PWD

I would like to make an alias called Ls which prints out the current directory and file name when I try to list a specific file unix> ls a.txt unix> a.txt -> print out I want it to print ...

Show Detail

Unix find command having multiple strings in a word

I have many files in a directory like, "abc_pqr_xyz", "abc_msno_xyz"........ I'm using find command in unix like find "$PWD"/script/*abc**xyz* but no answer I had already tried &

Show Detail

How to find all symbolic link in PWD which refer to files outside of PWD? unix

i can find all link in dir by command: find . -type l But i need link which only refer to files outside of PWD. Can anybody say how to do it? Thanks.

Show Detail

Unix command to create file:/// URI based on the file's directory (pwd)

I would like to write a filepath as a URI in a Unix command-line emulator. Desired output: file:///C|/directory/filename.ext Using sed and pwd I can get close but not quite there because $ pwd...

Show Detail

Duplicated output when using: `find pwd .`

I am trying to find some files and get the absolute path. If I use: find `pwd` . I get the files with absolute path but I also get them from ./ If I use: find `pwd` then I just get the files on...

Show Detail

Variable causing issue while doing the test command in unix:: find $PWD -type d -exec sh -c 'test "{}" ">" "$PWD/$VersionFolders"' ; -print|wc -l`

Variable causing issue while doing the test command in unix Command is:: find $PWD -type d -exec sh -c 'test "{}" ">" "$PWD/$VersionFolders"' \; -print|wc -l` Input

Show Detail

Using SQLPLUS command in UNIX scripts

I am trying to understand a simple script that connects to Oracle database using sqlplus command in unix: 1 sqlplus -s /nolog > /dev/null 2>&1 <<EOF 2 whenever sqlerror exit failur...

Show Detail

Does $PWD always equal ${${:-.}:A}

Given A modern Linux/UNIX/OSX zsh 5+ setopt chase_links PWD has not been set abnormally Is [[ "$PWD" == "${${:-.}:A}" ]] Always true?

Show Detail